#include<cstdlib>
#include<iostream>
using namespace std;
int vis[10000];
int main()
{
    srand(0);
    int n,mod,cnt=0;cin>>n;cin>>mod;
    while(cnt<n)
    {
        int xnew=rand();
        int x=xnew%mod;
        if(vis[x]) continue;
        vis[x]=1;cnt++;
        cout<<x<<" ";
    }
}